package com.kgcx.coupon.service;
import com.kgcx.coupon.domain.PullRule;
import com.kgcx.coupon.mapper.PullRuleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 何凯
 * @version 0.1
 * @description 拉新配置
 * @time 2017/12/15 16:52
 * @since 0.1
 */
@Service
public class PullRuleService {
    @Autowired
    private PullRuleMapper pullRuleMapper;

    public int insertSelective(PullRule record){
        return pullRuleMapper.insert(record);
    }
    public int deleteByPrimaryKey(Integer kid){
        return pullRuleMapper.deleteByPrimaryKey(kid);
    }

    public void insertByBatch(List<PullRule> list){
        pullRuleMapper.insertByBatch(list);
    }
    
    /**
     * 根据拉新配置ID获取累计拉新配置
     * @param pullConfigId
     * @return
     */
    public List<PullRule> selectPullRuleByConfigId(Integer pullConfigId) {
    		return pullRuleMapper.selectPullRuleByConfigId(pullConfigId);
    }
}
